<?php


namespace App\Http\Controllers;


use App\Services\AuthService;
use App\Transformer\UserTransformer;
use Dingo\Api\Http\Request;

class AuthController extends Controller
{

    /**
     * 用户登录
     * @param Request $request
     * @return mixed
     * @author thanatos thanatos915@163.com
     */
    public function login(Request $request)
    {
        return $this->resArray(AuthService::Login($request));
    }

    /**
     * 获取用户信息
     * @author thanatos thanatos915@163.com
     */
    public function info()
    {
        return $this->response->item(AuthService::info(), new UserTransformer());
    }

}
